﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Threading;

namespace IVTQLBH.UTILITIES
{
    public class DefaultCultureResolver : ICultureResolver
    {
        private CultureInfo defaultCulture;

        public CultureInfo DefaultCulture
        {
            get
            {
                return this.defaultCulture;
            }
            set
            {
                this.defaultCulture = value;
            }
        }

        protected virtual CultureInfo GetDefaultLocale()
        {
            if (this.defaultCulture != null)
                return this.defaultCulture;
            else
                return Thread.CurrentThread.CurrentUICulture;
        }

        public virtual CultureInfo ResolveCulture()
        {
            return this.GetDefaultLocale();
        }

        public virtual void SetCulture(CultureInfo culture)
        {
            this.defaultCulture = culture;
        }
    }
}
